package oop3.Task;

public class Mouse {
    String name;
    int energy; //体力

    public Mouse(String name, int energy) {
        this.name = name;
        this.energy = energy;
    }

    public void show() {
        if (energy == 0) {
            System.out.println("老鼠" + name + "已被猫抓住咬死");
        }
        System.out.println("老鼠的名字:" + name + ",老鼠的体力:" + energy);
    }
}
